<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <ul id="list"></ul>
    <script>
      const ul = document.getElementById("list");
      const h = setInterval(function () {
        const ctx = prompt("content");
        if (ctx === null) {
          clearInterval(h);
          return;
        }
        const li = document.createElement("li");
        li.innerText = ctx;
        ul.append(li);
      });
    </script>
  </body>
</html>
